//@flow

/**
 * 点击空白处隐藏键盘
 */
import React, { Component } from 'react';
import { 
    Keyboard,
    TouchableWithoutFeedback,
 } from "react-native";

export const touchDismissKeyBoard = (Ele:React.Component)=>{
    return class Wrapper extends Ele {
        render(){
            return(
                <TouchableWithoutFeedback
                    style={{backgroundColor:'red'}}
                    onPress={()=>{
                        console.log('click dismiss')
                        Keyboard.dismiss()
                    }}>
                    {super.render()}
                </TouchableWithoutFeedback>
            )
        }
    }
}